﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.ServiceModel;

namespace PJ.Operation.WCF
{
    /// <summary>
    /// ClientBase object for WCF services.
    /// </summary>
    public class SaleInvoiceWCFClient : ClientBase<ISaleInvoiceWCFService>, ISaleInvoiceWCFService, IDisposable
    {

        public SaleInvoiceWCFClient()
            : base(typeof(ISaleInvoiceWCFService).Name)
        {
        }

        public SaleInvoiceWCFClient(string endpointConfigurationName) :
            base(endpointConfigurationName)
        {
        }

        public SaleInvoiceWCFClient(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        public SaleInvoiceWCFClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
        {
        }

        public SaleInvoiceWCFClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
        {
        }


        public CreateInvoiceResult CreateSaleInvoice(string customerId, string reference, List<string> inventoryItemIds, List<double> quantities, List<string> units)
        {
            return base.Channel.CreateSaleInvoice(customerId, reference, inventoryItemIds, quantities, units);
        }

        public void Dispose()
        {
            if (State == CommunicationState.Faulted)
                Abort();
            else
                Close();
        }


        #region Interface override


        #endregion     

    
    }
}
